let obj = {
    name:'csc',
    age:18,
    newobj:{
        name:'lyz',
        age:18
    }
}


Object.prototype.myAssign = function(obj, ...args) {
    if(obj == null) {
        throw new TypeError('err')
    }
    let newobj = Object(obj)
   args.forEach(item => {
    if(obj == null) {
        throw new Error('err')
    }
    for(let i in item) {
        if(item.hasOwnProperty(i)) {
            newobj[i] = item[i]
        }
    }
   })
    return newobj
}

let a = null

let newObj = Object.myAssign(obj, 1)

newObj.newobj.name = 123

console.log(obj);